package Question03;

public class Library {
    int num=10;
    int cnt=0;
    Book[] book1 = new Book[num];
    public void addBook(Book book)
    {
        cnt++;
        if(cnt>num){
            System.out.println("图书库已满");
        }
        else
        {
            this.book1[cnt-1]=book;
        }
    }
    public void listAllBooks(){
        for (int i = 0; i < cnt; i++) {
            System.out.println("书名： " + book1[i].bookName + " 作者： " +
                    book1[i].bookWrite +" ISBN： " + book1[i].ISBN );
        }
    }
}
